As a conventional system well-known in the art, there is known a system including an ink cartridge, and an inkjet-recording apparatus provided with an attachment section to which the ink cartridge is detachably attachable.
As disclosed in Japanese Patent Application Publication No. 2013-049164, an ink cartridge may be provided with a rib or other light-blocking portion, and an optical sensor may be provided in an attachment section of an inkjet-recording apparatus. When the ink cartridge is attached to the attachment section, the light-blocking portion of the ink cartridge is positioned in an optical path of the optical sensor. However, the light-blocking portion is not positioned in the optical path of the optical sensor when the ink cartridge is not mounted in the attachment section. Hence, the signal outputted by the optical sensor changes based on whether the ink cartridge is mounted in the attachment section. In this way, the inkjet-recording apparatus can determine whether the ink cartridge is attached to the attachment section depending on changes in the signal outputted from the optical sensor.